type ProjRef [out T, C]
    &(Maybe[C]) => (T, C);

export method ProjRef.read: C
    &(f) => let (_, c) := { f None }, c;

export method ProjRef.write: &(C) => T
    &(f) => &(c) => let (t, _) := { f { Some c } }, t;


type CaseRef [out T, C]
    &(Maybe[C]) => (T, Maybe[C]);

export method CaseRef.read: Maybe[C]
    &(f) => let (_, c?) := { f None }, c?;

export method CaseRef.write: &(C) => T
    &(f) => &(c) => let (t, _) := { f { Some c } }, t;


